<?php

	/*
		Filename: index.php
		Description: The main page where the design is and includes pages into it's body.
		
		Last Edit: 13-08-2012 (dd-mm-yyyy)
	*/
   
	session_start();
	require_once('./Config/Config.php');
	require_once('./Config/Functions.php');
?>

<html>
	<head>
	
		<!-- Page Title (From database) -->
		<title><?php echo GetSetting('page_title'); ?></title>
		
		<!-- Include CSS File -->
		<link rel="stylesheet" type="text/css" href="./Config/Style.css" />
	</head>
	
	<body class="MainFonts">
		<!-- Blue Header at top -->
		<div class="TopHeader">
			<p class="HeaderFont">
				<!-- Get defined title from settings -->
				<?php
					echo GetSetting('header_title');
				?>
			</p>
		</div>
		
		<!-- Menu -->
		<div class="MenuHeader">
			<div class="MenuItems">
				<a class="MenuItem" href="./index.php?p=main">Home</a>
				<?php if(isAdmin() == true) echo '<a class="MenuItem" href="./index.php?p=admincps">Control Panel</a>';
				else echo '<a class="MenuItem" href="./index.php?p=admincp">Control Panel</a>'; ?>
			</div>
		</div>
		
		<div class="StatusHeader">
			<?php
				if(isAdmin() == true)
				{
					echo 'Logged in as: ' . $_SESSION['admin_id'];
				}
			?>
		</div>
		
		<!-- Content Inclusion -->
		<div class="MainContent">
			<?php
				if(require_once('./Pages/' . $_GET['p'] . '.php') == false)
        {
          require_once("./Pages/main.php");
        }
			?> 
		</div>
	</body>
</html>